<template>
  <div class="container" style="margin-top: 0">
    <div class="container-title">
      <oneTitle :showMore="true" src="Tour" title="城市公益巡讲"></oneTitle>
    </div>
    <buildElThreeList
      @handDetails="handDetails"
      :tableData="tableData"
    ></buildElThreeList>
  </div>
</template>
<script>
import buildElH1 from "../build-el-h1";
import buildElMore from "../build-el-more";
import buildElThreeList from "../build-el-three-list";
export default {
  components: {
    buildElH1,
    buildElMore,
    buildElThreeList,
  },
  data() {
    return {
      tableData: null,
      total: 0,
      pageSize: 6,
      pageNow: 1,
    };
  },
  async created() {
    await this.init(1);
  },
  methods: {
    handDetails(id, item) {
      console.log(item, "咋回事");
      if (item.pcJumpLink) {
        window.open(item.pcJumpLink);
      } else if (item.mobileJumpLink) {
        window.open(item.mobileJumpLink);
      } else {
        this.toPage(id, "城市公益巡讲");
      }
    },

    async init(page) {
      this.tableData = [];
      let tableData = await this.api.selectNewsList(page, 3);
      this.total = tableData.total;
      this.tableData = tableData.list;
      console.log("tableData", this.tableData);
    },
    changePage(e) {
      this.pageNow = e;
      this.init(e);
    },
  },
};
</script>
<style lang="less" scoped>
.container {
  .container-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
}
</style>
